package com.hk.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.hk.model.CustUserDto;
import com.hk.model.ICustUserService;
import com.jungbo.paging.ResultLists;
//com.hk.controller.CustUserController
public class CustUserController extends AbstractController {
	private ICustUserService custUserService;
	
	public void setCustUserService(ICustUserService custUserService) {
		this.custUserService = custUserService;
	}

	@Override
	protected ModelAndView handleRequestInternal(
			HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		ModelAndView mav=new ModelAndView();
		int startPage=1;
		int startBlock=1;
		String sstartPage=request.getParameter("startPage");
		String sstartBlock=request.getParameter("startBlock");
		if(sstartPage!=null){
			startPage=Integer.parseInt(sstartPage);
		}
		if(sstartBlock!=null){
			startBlock=Integer.parseInt(sstartBlock);
		}
		ResultLists<CustUserDto> custlists= 
			custUserService.getAllCustUsers(startPage,
				startBlock);
		mav.addObject("custs", custlists);
		mav.setViewName("custuserlist");
		return mav;
	}//
}//









